import axios from '@/utils/http'
// 登陆
export function login (params) {
  return axios.getData({
    url: 'api/v1/admin/user/login',
    method: 'post',
    params: params
  })
}
// 获取用户列表
export function getUserList (data) {
  data = data === undefined ? '' : '&org_id=' + data
  return axios.getData({
    url: 'api/v1/admin/org/userPage?filter=A.state|=|1' + data,
    method: 'get'
  })
}
// 获取客户列表
export function getCustomerList (data, page) {
  data = data !== undefined ? ',A.name|like|' + data : ''
  page = page !== undefined ? page : 1
  return axios.getData({
    url: 'api/v1/customer/customer/page?filter=state|=|1' + data + '&page=' + page,
    method: 'get'
  })
}
// 获取单个客户信息
export function getCustomerDetail (id) {
  return axios.getData({
    url: 'api/v1/customer/customer/find?id=' + id,
    method: 'get'
  })
}
// 修改客户信息
export function updataCustomerDetail (params) {
  return axios.getData({
    url: 'api/v1/customer/customer/update',
    method: 'post',
    params: params
  })
}
// 新增客户信息
export function addCustomerDetail (params) {
  return axios.getData({
    url: 'api/v1/customer/customer/add',
    method: 'post',
    params: params
  })
}
// 获取客户体检列表
export function getReports (id, page) {
  return axios.getData({
    url: 'api/v1/customer/examination/list?page=' + page + '&filter=customer_id|=|' + id,
    method: 'get'
  })
}
// 获取客户单条体检信息
export function getCusReport (id) {
  return axios.getData({
    url: 'api/v1/customer/examination/find?id=' + id,
    method: 'get'
  })
}
// 添加客户单条体检信息
export function addCusReport (params) {
  return axios.getData({
    url: 'api/v1/customer/examination/add',
    method: 'post',
    params: params
  })
}
// 修改客户单条体检信息
export function updataeCusReport (params) {
  return axios.getData({
    url: 'api/v1/customer/examination/update',
    method: 'post',
    params: params
  })
}
export function getDics (params) {
  return axios.getData({
    url: 'api/v1/admin/dict',
    method: 'get'
  })
}
// 获取操作流程列表
export function getstandards (params) {
  return axios.getData({
    url: 'api/v1/customer/standard/page?field=id,name,is_sb',
    method: 'get'
  })
}
// 获取具体操作流程
export function getstandard (id) {
  return axios.getData({
    url: 'api/v1/customer/standard/find?id=' + id,
    method: 'get'
  })
}
export function updatePassword (data) {
  return axios.getData({
    url: 'api/v1/admin/user/updatetPassword',
    method: 'post',
    params: data
  })
}

// 抽脂
// export function czRecordList (data, page) {
//   data = data !== undefined ? '&filter=B.name|like|' + data : ''
//   page = page !== undefined ? page : 1
//   return axios.getData({
//     url: 'api/v1/customer/projectApplication/list' + '?page=' + page + data,
//     method: 'get'
//   })
// }
export function czRecordList (data, page) {
  return axios.getData({
    url: 'api/v1/customer/projectApplication/list' + '?page=' + page + '&filter=A.customer_id|=|' + data,
    method: 'get'
  })
}
export function czRecordFind (id) {
  return axios.getData({
    url: 'api/v1/customer/projectApplication/find?id=' + id,
    method: 'get'
  })
}
export function czRecordUpdate (data) {
  return axios.getData({
    url: 'api/v1/customer/projectApplication/update',
    method: 'post',
    params: data
  })
}
export function czRecordAdd (data) {
  return axios.getData({
    url: 'api/v1/customer/projectApplication/add',
    method: 'post',
    params: data
  })
}
export function getOrgCusList () {
  return axios.getData({
    url: 'api/v1/customer/customer/org',
    method: 'get'
  })
}

// 获取填写运输单列表
export function getshipList (data, page) {
  data = data !== undefined ? '&filter=ship_name|like|' + data : ''
  page = page !== undefined ? page : 1
  return axios.getData({
    url: 'api/v1/customer/expressNotice/list?page=' + page + data,
    method: 'get'
  })
}
// 运输单条记录
export function getshipFind (id) {
  return axios.getData({
    url: 'api/v1/customer/expressNotice/find?id=' + id,
    method: 'get'
  })
}
// 添加运输单条记录
export function getshipAdd (data) {
  return axios.getData({
    url: 'api/v1/customer/expressNotice/add',
    method: 'post',
    params: data
  })
}
// 修改运输单条记录
export function getshipUpdate (data) {
  return axios.getData({
    url: 'api/v1/customer/expressNotice/update',
    method: 'post',
    params: data
  })
}
export function getshippingInfo () {
  return axios.getData({
    url: 'api/v1/customer/expressNotice/addInfo',
    method: 'get'
  })
}
